#ifndef _IUAPPLICATION_HPP_
#define _IUAPPLICATION_HPP_

#ifdef _SOLARIS_
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#include "iuShell.hpp"
#include "iuModuleIP.hpp"
#include "iuModuleARP.hpp"

#define NUM_COMMANDS 5

class iuCommand;
class iuInterface;

/**
 * @brief Classe centrale de l'application regroupant les differents modules:
 * le shell, les commandes supportees, le module IP, le module ARP, la liste des interfaces...
 */
class iuApplication
{
public:
   iuApplication();
   ~iuApplication();
   
   void run(const char *cmdFile, bool useFifo);
   
   iuInterface *getInterfaces();
   iuInterface *getInterfaceByNumber(unsigned char interfaceNum);
   iuInterface *addInterface(uint16_t port);
   bool         delInterface(unsigned char interfaceNum);

   iuModuleARP &getModuleARP();
   iuModuleIP  &getModuleIP();
   
private:
   iuShell m_shell;
   iuCommand *m_commands[NUM_COMMANDS];
   iuInterface *m_interfaces;
   bool m_useFifo;
   
   iuModuleARP m_moduleARP;
   iuModuleIP m_moduleIP;
};

#endif
